<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
  
  </style>
</head>
<body>
  <h2>在box元素中动态创建无序列表</h2>
  <div id="box">

  </div>
  <script>
  var box = document.getElementById('box');
  var ul = document.createElement('ul');
  
  for (var i = 1; i < 11; i++){
    var li =  document.createElement('li');
    li.innerText = "第"+i+"个无序元素";
    ul.append(li);
  }
  box.append(ul);
  
 
  </script>
</body>
</html>